package com.jwetherell.my.tree;

import com.jwetherell.my.BinaryHeap;

public class TestTree {

	public static void main(String[] args) {

		/**
		 * Binary Heap
		 */
//		BinaryHeap<Integer> heap = new BinaryHeap<Integer>();
//		heap.insertThroughBottomUpApproach(5);
//		heap.insertThroughBottomUpApproach(4);
//		heap.insertThroughBottomUpApproach(3);
//		heap.insertThroughBottomUpApproach(2);
//		heap.insertThroughBottomUpApproach(1);
//		heap.printHeap();
		
		
		
		/**
		 * Tree
		 */
//		Node<Integer> root = TreeUtils.createTree1();
		Node<Integer> rootT1 = TreeUtils.createBST1();

		TreeUtils.printTree(rootT1);
		TreeUtils.BFS_ZigZag_Iterative(rootT1);
		
		
//		
//		/*
//		 * Assigning height to each node
//		 * Assigning levels to each node
//		 */
//		TreeUtils.assignHeightsToEachNode(rootT1);
//		TreeUtils.assignLevelsToEachNode(rootT1, 0);
//		
//		TreeUtils.printTree(rootT1);
//		
//		/*
//		 * Tree traversals
//		 */
//		System.out.print("DFS_PreOrder_Recursive: ");
//		TreeUtils.DFS_PreOrder_Recursive(rootT1);
//		System.out.println();
//		
//		System.out.print("DFS_InOrder_Recursive: ");
//		TreeUtils.DFS_InOrder_Recursive(rootT1);
//		System.out.println();
//		
//		System.out.print("DFS_PostOrder_Recursive: ");
//		TreeUtils.DFS_PostOrder_Recursive(rootT1);
//		System.out.println();
//
//		System.out.print("DFS_PreOrder_Iterative(left-to-right): ");
//		TreeUtils.DFS_PreOrder_Iterative_Left_To_Right(rootT1);
//		System.out.println();
//		
//		System.out.print("DFS_PreOrder_Iterative(right-to-left): ");
//		TreeUtils.DFS_PreOrder_Iterative_Right_To_Left(rootT1);
//		System.out.println();
//		
//		System.out.println();
//		System.out.print("BFS_Iterative: ");
//		TreeUtils.BFS_Iterative(rootT1);
//		System.out.println();
//		
//		
//		/*
//		 * Heights, Levels
//		 */
//		System.out.println();
//		System.out.print(String.format("Min. Level: %d \n", TreeUtils.minLevel(rootT1)));
//		
//		System.out.print(String.format("Height / Max. Level (using DFS): %d \n", TreeUtils.heightOrMaxLevelUsingDFS(rootT1)));
//		System.out.print(String.format("Height / Max. Level (using BFS): %d \n", TreeUtils.heightOrMaxLevelUsingBFS(rootT1)));
//		
//		
//		/*
//		 * Insert
//		 */
////		int newNode = 17;
////		TreeUtils.insertIntoBST(rootT1, newNode);
////		System.out.println();
////		System.out.print("After inserting node: " + newNode + "\n");
////		TreeUtils.printTree(rootT1);
////		System.out.println();
	}
}